package com.hfjyz.call.bean;

import java.util.ArrayList;
import java.util.List;

import com.hfjyz.base.bean.BaseBean;
import com.hfjyz.base.util.BaseUtil;

public abstract class CallBean extends BaseBean {

    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = -4377972252216447694L;

    protected Integer id = null;
    protected String callName = null;
    protected String callReason = null;
    protected String callRemark = null;
    protected Integer callAim = null;

    public String getCallName() {
        return callName;
    }

    public void setCallName(String callName) {
        this.callName = callName;
    }

    public String getCallReason() {
        return callReason;
    }

    public void setCallReason(String callReason) {
        this.callReason = callReason;
    }

    public String getCallRemark() {
        return callRemark;
    }

    public void setCallRemark(String callRemark) {
        this.callRemark = callRemark;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Override
    public Integer getId() {
        return id;
    }

    public Integer getCallAim() {
        return callAim;
    }

    public void setCallAim(Integer callAim) {
        this.callAim = callAim;
    }

    @Override
    public String validate() {
        List<String> errorList = new ArrayList<String>();
        if (callName.length() > 64) {
            errorList.add("调用名长度不能超过64");
        }
        if (callReason.length() > 2048) {
            errorList.add("调用缘由长度不能超过2048");
        }
        if (callRemark.length() > 2048) {
            errorList.add("调用备注长度不能超过2048");
        }
        return getErrMsgForUI(errorList);
    }

    public void decodeChangeLine() {
        setCallReason(BaseUtil.decodeChangeLine(getCallReason()));
        setCallRemark(BaseUtil.decodeChangeLine(getCallRemark()));
    }
}
